<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />

<cfoutput>
    
<!---HTML header, css links, js links, and page title--->
#BASE.htmlHeaderNonSCF(
    "", <!---JS links--->
    "", <!---CSS links--->
    "Step 2:  HR - Manual EPLS Check", <!---Page Title--->
    "Status", <!---Active Nav Link--->
    "true" <!---Alternate menu.  Shows main EPAR links--->
)#<!---HTML header, css links, js links, and page title--->

<!--- URL.ID is the "Step Action ID" --->
<cfquery name="qryGetEmpInfo" datasource="#Session.DataSource#">
	scf_GetEmpInfoByStep #URL.StepID#
	<!--- --scf_GetEmpInfo #URL.ID# --->
</cfquery>
      
<cfset intStepID = URL.ID>  
<cfset intEmpID = qryGetEmpInfo.ID>

<cfif isdefined("Form.rdoEPLS")>
	<cfset strComments = Form.txtComments>
    <cfquery name="qryGetStep3ID" datasource="#Session.DataSource#">
        scf_GetEmpCurrStep #intEmpID#
    </cfquery>
    <cfset intStep3ID = qryGetStep3ID.ID>  
    
	<cfif Form.rdoEPLS EQ 1>
		<cfquery name="qryStep3UpdateEPLS" datasource="#Session.DataSource#">
			scf_UpdateAction #intStepID#, #Session.intUserRosettaID#, '#strComments#'
		</cfquery>
		<cfquery name="qryNonSCFStep2InsertAction" datasource="#Session.DataSource#">
			scf_InsertAction #intEmpID#, 3  
		</cfquery>
        <cflocation url="Step2-Orientation2.cfm?ID=#intStep3ID#">  
        <!---cflocation url="Step3-SpawnCreation.cfm?ID=#intStep3ID#"--->  
    <cfelse>   
		<cfquery name="qryStep3UpdateEPLS" datasource="#Session.DataSource#">
			scf_UpdateAction #intStepID#, #Session.intUserRosettaID#, '#strComments#'
		</cfquery>   

        <cflocation url="Step2-EPLSConfirmation.cfm?EmpID=#intEmpID#">  
    </cfif>

</cfif>
    				
    <cfif qryGetEmpInfo.recordcount GT 0>
    
    	<cfset strFirst = qryGetEmpInfo.First>
    	<cfset strPref = qryGetEmpInfo.PreferredName>
        <cfset strLast = qryGetEmpInfo.Last>
        <cfset strSSN = qryGetEmpInfo.SSN>
        
		<cfset strName = qryGetEmpInfo.First>
        <cfif qryGetEmpInfo.PreferredName NEQ "">
            <cfset strName = strName & ' (' & qryGetEmpInfo.PreferredName & ')'>
        </cfif>
        <cfif qryGetEmpInfo.Middle NEQ "">
            <cfset strName = strName & ' ' & qryGetEmpInfo.Middle>
        </cfif>
        <cfset strName = strName & ' ' & qryGetEmpInfo.Last>
        <cfset intEmpID = qryGetEmpInfo.ID>        
        
        <cfif not isdefined("Session.NotCleared") OR Session.NotCleared[1].EmpID NEQ intEmpID>
            <cfset bolCleared = EPLSCheck('#strFirst#', '#strLast#', '#strSSN#', #intEmpID#)>
            <cfset Session.NotCleared = arrNotCleared>
        </cfif>
        
		<cfoutput>
                The employee, '#strName#', had one or more hits on the EPLS 
                exclusion list as part of the E-PAR automated check.  
                You'll need to complete a manual check for this employee.  
                Follow the instructions below to complete this step.  
                This a list of the possible matches:
            <cfform name="frmEPLS" method="post">
            <table cellpadding="0" cellspacing="0" width=100%>
                <tr>
                    <td colspan="3">
                        <table>
                            <tr>
                                <td>
                                    <strong><u>SCF Name</u></strong>
                                </td>
                                <td width="15">&nbsp;</td>
                                <td>
                                    <strong><u>EPLS Name</u></strong>
                                </td>
                                <td width="15">&nbsp;</td>
                                <td>
                                    <strong><u>SSN</u></strong>
                                </td>
                                <td width="15">&nbsp;</td>
                                <td>
                                    <strong><u>EPLS Error Message</u></strong>
                                </td>
                            </tr>
                            <cfloop from=1 to=#arrayLen(Session.NotCleared)# index="intX">
                            <tr>
                                <td valign="top" nowrap="nowrap">
                                    #Session.NotCleared[intX].EmpName#
                                </td>
                                <td>&nbsp;</td>
                                <td valign="top" nowrap="nowrap">
                                    #Session.NotCleared[intX].EPLSName#
                                </td>
                                <td>&nbsp;</td>
                                <td valign="top">                          
                                    #Session.NotCleared[intX].SSN#
                                </td>
                                <td>&nbsp;</td>
                                <td valign="top">
                                    <cfif Session.NotCleared[intX].Error EQ "">
                                        No error returned.  <em>Possible Exact Match<em>
                                    <cfelse>                         
                                        #Session.NotCleared[intX].Error#
                                    </cfif>
                                </td>
                            </tr>
                            </cfloop>
                        </table>
                    </td>
                <tr>

                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3" nowrap="nowrap">
                        1) Search for the employee at the EPLS site 
                        (using the EPLS Name <em>exactly</em>):&nbsp;&nbsp;
                        <a href="http://www.epls.gov/epls/search.do?ssn=true" 
                            target="_blank">EPLS Advanced SSN Search</a>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;
                        
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;
                        
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        2) Did the employee pass or fail the EPLS check?
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <cfinput type="radio" 
                        name="rdoEPLS" checked="yes" value="1" 
                        tabindex="10"> Passed (Does not appear on the EPLS List - Continue to the Next Step)<BR />
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <cfinput type="radio" 
                        name="rdoEPLS" value="0" tabindex="20"> 
                         Failed (Appears on the EPLS List - Notify HR Management)
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;
                        
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;
                        
                    </td>
                </tr>
                <tr>
                    <td nowrap="nowrap" valign="top" colspan="3">
                        3) HR Comments:<BR />
                        &nbsp;&nbsp;&nbsp;&nbsp;<cftextarea name="txtComments" 
                                    style="width:96%" tabindex="30"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3" align="right">
                        <cfinput type="submit" name="cmdNext" value="Next >>" 
                        tabindex="40">
                    </td>
                </tr>
            </table>
            </cfform>
        </cfoutput>    
    <cfelse>
        This employee has already been processed in Step 3.1.   
        To select another user, click <a href="Step3-Orientation1.cfm">Here</a>
    </cfif>
            

<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlFooterNonSCF()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>


